package prectise2;

class Circle{
    private double r;
    private static double a=3.1415926;
    public void setr(double r){
        this.r=r;
    }
    public double getr() {
        return r;
    }
    public void mianji(){
        double m;
        m=a*r*r;
        System.out.println("mianji=" + m );
    }
    public void zhouchang(){
        double z;
        z=2*a*r;
        System.out.println("zhouchang="+z);
    }
};

public class CircleOperator {
    public static void main(String[] args){
        Circle rou1 = new Circle();
        double r;
        rou1.setr(3);
        r=rou1.getr();
        System.out.println("r=" + r);
        rou1.mianji();
        rou1.zhouchang();
    }
}
